public class Student
{
	//定义name,age,gender,phone,address,email成员变量
	private String name;
	private int age;
	private String gender;
	private String phone;
	private String address;
	private String email;
	public void setName(String name)
	{
		this.name = name;
	}
	public String getName()
	{
		return this.name;
	}
	public void setAge(int age)
	{
		this.name = name;
	}
	public int getAge()
	{
		return this.age;
	}
	public void setGender(String gender)
	{
		this.name = name;
	}
	public String getGender()
	{
		return this.gender;
	}
	public void setPhone(String phone)
	{
		this.phone = phone;
	}
	public String getPhone()
	{
		return this.phone;
	}
	public void setAddress(String address)
	{
		this.address = address;
	}
	public String getAddress()
	{
		return this.address;
	}
	public void setEmail(String email)
	{
		this.email = email;
	}
	public String getEmail()
	{
		return this.email;
	}
	//创建默认构造器 重点!
	public Student(){

	}
	public Student(String name,int age,String gender,String phone,String address,String email)
	{
		this.name = name;
		this.age = age;
		this.gender = gender;
		this.phone = phone;
		this.address = address;
		this.email = email;
	}
	public void eat()
	{
		System.out.println("吃...");
	}
	public void drink()
	{
		System.out.println("喝...");
	}
	public void play()
	{
		System.out.println("玩...");
	}
	public void sleep()
	{
		System.out.println("睡...");
	}
	public static void main(String[] args)
	{
		Student[] stu = new Student[2];
		stu[0] = new Student("lyb",25,"男","bobo159357456","北京","41377284@qq.com");
		stu[1] = new Student("lili",20,"女","13800138000","北京","lili@qq.com");
		String name = "lyb";
		String email= "41377284@qq.com";
		String address = "北京";
		System.out.println(stu.length);
		//System.out.println(stu[0].name+" "+stu[1].gender);
		if(name!=null)
		{
			for(int i = 0; i < stu.length;i++)
			{
				System.out.println("hello for"+stu[i].name);
				if (name==stu[i].name) {
					System.out.println("存在的数据:"+stu[i].name);
				}else{
					System.out.println("没有数据");
				}
			}
		}
		if(email!=null)
		{
			for (int i =0;i < stu.length ; i++ ) {
				if(email == stu[i].email){
					System.out.println("存在数据: "+stu[i].email);
				}else{
					System.out.println("没有数据");
				}
			}
		}
		if (address!=null) {
			for (int i = 0;i < stu.length ;i++ ) {
				if(address == stu[i].address){
					System.out.println("存在的数据:"+stu[i].address);
				}else{
					System.out.println("没有数据");
				}
			}
		}
	}
}